 package tools.packet;


import client.*;
import client.inventory.*;
import client.skills.InnerSkillEntry;
import client.skills.Skill;
import client.skills.SkillEntry;
import client.skills.SkillFactory;
import constants.GameConstants;
import constants.ItemConstants;
import constants.JobConstants;
import constants.SkillConstants;
import server.MapleItemInformationProvider;
import server.movement.LifeMovementFragment;
import server.quest.MapleQuest;
import server.shop.MapleShop;
import server.shop.MapleShopItem;
import server.shops.AbstractPlayerStore;
import server.shops.IMaplePlayerShop;
import tools.*;
import tools.data.output.MaplePacketLittleEndianWriter;

import java.awt.*;
import java.util.*;
import java.util.List;


 public class PacketHelper {
   public static final long MAX_TIME = 150842304000000000L;

   public static long getKoreanTimestamp(long realTimestamp) {
/*   36 */     return realTimestamp * 10000L + 116444592000000000L;
   }
   public static final long ZERO_TIME = 94354848000000000L; public static final long PERMANENT = 150841440000000000L;
   public static long getTime(long realTimestamp) {
/*   40 */     if (realTimestamp == -1L)
/*   41 */       return 150842304000000000L; 
/*   42 */     if (realTimestamp == -2L)
/*   43 */       return 94354848000000000L; 
/*   44 */     if (realTimestamp == -3L) {
/*   45 */       return 150841440000000000L;
     }
/*   47 */     return DateUtil.getFileTimestamp(realTimestamp);
   }




   public static void addPotionPotInfo(MaplePacketLittleEndianWriter mplew, MaplePotionPot potionPot) {
/*   54 */     mplew.writeInt(potionPot.getItmeId());
/*   55 */     mplew.writeInt(potionPot.getChrId());
/*   56 */     mplew.writeInt(potionPot.getMaxValue());
/*   57 */     mplew.writeInt(potionPot.getHp());
/*   58 */     mplew.writeInt(potionPot.getMp());
/*   59 */     mplew.writeLong(getTime(potionPot.getStartDate()));
/*   60 */     mplew.writeLong(getTime(potionPot.getEndDate()));
   }


   public static void addCharStats(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/*   65 */     mplew.writeInt(chr.getId());
/*   66 */     mplew.writeInt(chr.getId());
/*   67 */     mplew.writeInt(chr.getWorld());
/*   68 */     mplew.writeAsciiString(chr.getName(), 13);

/*   70 */     mplew.write(chr.getGender());
/*   71 */     mplew.write(chr.getSkinColor());
/*   72 */     mplew.writeInt(chr.getFace());
/*   73 */     mplew.writeInt(chr.getHair());

/*   75 */     mplew.write(chr.getHairBaseColor());
/*   76 */     mplew.write(chr.getHairMixedColor());
/*   77 */     mplew.write(chr.getHairProbColor());

/*   79 */     mplew.writeInt(chr.getLevel());
/*   80 */     mplew.writeShort(chr.getJob());
/*   81 */     chr.getStat().connectData(mplew);
/*   82 */     mplew.writeShort(chr.getRemainingAp());
/*   83 */     addCharSP(mplew, chr);
/*   84 */     mplew.writeLong(chr.getExp());
/*   85 */     mplew.writeInt(chr.getFame());
/*   86 */     mplew.writeInt(chr.getWeaponPoint());
/*   87 */     mplew.writeLong(0L);
/*   88 */     mplew.writeLong(DateUtil.getFileTimestamp(System.currentTimeMillis()));
/*   89 */     mplew.writeInt(chr.getMapId());
/*   90 */     mplew.write(chr.getInitialSpawnpoint());
/*   91 */     mplew.writeShort((short)chr.getSubcategory());
/*   92 */     if (chr.hasDecorate()) {
/*   93 */       mplew.writeInt(chr.getDecorate());
     }
/*   95 */     mplew.writeShort(chr.getFatigue());
/*   96 */     mplew.writeInt(DateUtil.getTime());




/*  101 */     for (MapleTraitType t : MapleTraitType.values()) {
/*  102 */       mplew.writeInt(chr.getTrait(t).getTotalExp());
     }

/*  105 */     mplew.writeZeroBytes(13);
/*  106 */     mplew.writeLong(getTime(-2L));




/*  111 */     mplew.writeInt((chr.getStat()).pvpExp);
/*  112 */     mplew.write((chr.getStat()).pvpRank);
/*  113 */     mplew.writeInt(chr.getBattlePoints());
/*  114 */     mplew.write(5);
/*  115 */     mplew.write(6);

/*  117 */     mplew.writeInt(0);


/*  120 */     chr.getCharacterCard().connectData(mplew);

/*  122 */     mplew.writeReversedLong(getTime(System.currentTimeMillis()));
/*  123 */     mplew.writeLong(getTime(-1L));
/*  124 */     mplew.writeLong(getTime(-2L));
/*  125 */     mplew.writeZeroBytes(17);
/*  126 */     mplew.write(0);
/*  127 */     mplew.writeInt(0);
   }


   public static void addCharSP(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/*  132 */     if (JobConstants.isSeparatedSpJob(chr.getJob())) {
/*  133 */       mplew.write(chr.getRemainingSpSize());
/*  134 */       for (int i = 0; i < (chr.getRemainingSps()).length; i++) {
/*  135 */         if (chr.getRemainingSp(i) > 0) {
/*  136 */           mplew.write(i + 1);
/*  137 */           mplew.writeInt(chr.getRemainingSp(i));
         }
       }
/*  140 */     } else if (JobConstants.is暗影双刀(chr.getJob())) {
/*  141 */       int sp1 = 0, sp2 = 0;
/*  142 */       List<Pair<Integer, Integer>> splist = new ArrayList<>();
/*  143 */       for (int i = 0; i < (chr.getRemainingSps()).length; i++) {
/*  144 */         if (i < 2) {
/*  145 */           sp1 += chr.getRemainingSp(i);
/*  146 */           if (i == 1 && sp1 > 0) {
/*  147 */             splist.add(new Pair(Integer.valueOf(0), Integer.valueOf(sp1)));
/*  148 */             splist.add(new Pair(Integer.valueOf(1), Integer.valueOf(sp1)));
           }
/*  150 */         } else if (i < 4) {
/*  151 */           sp2 += chr.getRemainingSp(i);
/*  152 */           if (i == 3 && sp2 > 0) {
/*  153 */             splist.add(new Pair(Integer.valueOf(2), Integer.valueOf(sp2)));
/*  154 */             splist.add(new Pair(Integer.valueOf(3), Integer.valueOf(sp2)));
           }
/*  156 */         } else if (chr.getRemainingSp(i) > 0) {
/*  157 */           splist.add(new Pair(Integer.valueOf(i), Integer.valueOf(chr.getRemainingSp(i))));
         }
       }
/*  160 */       mplew.write(splist.size());
/*  161 */       for (Pair<Integer, Integer> sp : splist) {
/*  162 */         if (((Integer)sp.right).intValue() > 0) {
/*  163 */           mplew.write(((Integer)sp.left).intValue() + 1);
/*  164 */           mplew.writeInt(((Integer)sp.right).intValue());
         }
       }
     } else {
/*  168 */       mplew.writeShort(chr.getRemainingSp());
     }
   }

   public static void addPartTimeJob(MaplePacketLittleEndianWriter mplew, MaplePartTimeJob parttime) {
/*  173 */     mplew.write(parttime.getJob());
/*  174 */     if (parttime.getJob() > 0 && parttime.getJob() <= 5) {

/*  176 */       mplew.writeReversedLong(parttime.getTime());
     } else {
/*  178 */       mplew.writeReversedLong(getTime(-2L));
     }
/*  180 */     mplew.writeInt(parttime.getReward());
/*  181 */     mplew.writeBool((parttime.getReward() > 0));
   }

   public static void addCharLook(MaplePacketLittleEndianWriter mplew, MapleCharacter chr, boolean mega, boolean second) {
/*  185 */     mplew.write(second ? chr.getSecondGender() : chr.getGender());
/*  186 */     mplew.write(chr.getSkinColor());
/*  187 */     mplew.writeInt(second ? chr.getSecondFace() : chr.getFace());
/*  188 */     chr.writeJobData(mplew);
/*  189 */     mplew.write(mega ? 0 : 1);
/*  190 */     mplew.writeInt(second ? chr.getSecondHair() : chr.getHair());

/*  192 */     Map<Byte, Integer> myEquip = new LinkedHashMap<>();
/*  193 */     Map<Byte, Integer> maskedEquip = new LinkedHashMap<>();
/*  194 */     Map<Byte, Integer> totemEquip = new LinkedHashMap<>();
/*  195 */     MapleInventory equip = chr.getInventory(MapleInventoryType.EQUIPPED);

/*  197 */     for (Item item : equip.newList()) {
/*  198 */       if (item.getPosition() <= -5000 && item.getPosition() > -5003) {
/*  199 */         byte b = (byte)(item.getPosition() * -1 - 5000);
/*  200 */         totemEquip.computeIfAbsent(Byte.valueOf(b), k -> Integer.valueOf(item.getItemId()));
       }
/*  202 */       if (item.getPosition() < -128) {
         continue;
       }



/*  208 */       byte pos = (byte)(item.getPosition() * -1);
/*  209 */       if (pos < 100 && myEquip.get(Byte.valueOf(pos)) == null) {
/*  210 */         Equip skin = (Equip)item;
/*  211 */         myEquip.put(Byte.valueOf(pos), Integer.valueOf((skin.getItemSkin() % 10000 > 0) ? skin.getItemSkin() : item.getItemId())); continue;
/*  212 */       }  if ((pos > 100 || pos == Byte.MIN_VALUE) && pos != 111) {
/*  213 */         pos = (byte)((pos == Byte.MIN_VALUE) ? 28 : (pos - 100));
/*  214 */         if (myEquip.get(Byte.valueOf(pos)) != null) {
/*  215 */           maskedEquip.put(Byte.valueOf(pos), myEquip.get(Byte.valueOf(pos)));
         }
/*  217 */         myEquip.put(Byte.valueOf(pos), Integer.valueOf(item.getItemId())); continue;
/*  218 */       }  if (myEquip.get(Byte.valueOf(pos)) != null) {
/*  219 */         maskedEquip.put(Byte.valueOf(pos), Integer.valueOf(item.getItemId()));
       }
     }







/*  229 */     boolean zero = JobConstants.is神之子(chr.getJob());







/*  237 */     for (Map.Entry<Byte, Integer> entry : myEquip.entrySet()) {
/*  238 */       mplew.write(((Byte)entry.getKey()).byteValue());
/*  239 */       mplew.writeInt(((Integer)entry.getValue()).intValue());
     }

/*  242 */     mplew.write(255);

/*  244 */     for (Map.Entry<Byte, Integer> entry : maskedEquip.entrySet()) {
/*  245 */       mplew.write(((Byte)entry.getKey()).byteValue());
/*  246 */       mplew.writeInt(((Integer)entry.getValue()).intValue());
     }

/*  249 */     mplew.write(255);

/*  251 */     mplew.write(255);

/*  253 */     for (Map.Entry<Byte, Integer> entry : totemEquip.entrySet()) {
/*  254 */       mplew.write(((Byte)entry.getKey()).byteValue());
/*  255 */       mplew.writeInt(((Integer)entry.getValue()).intValue());
     }

/*  258 */     mplew.write(255);


/*  261 */     Item cWeapon = equip.getItem((short)-111);
/*  262 */     mplew.writeInt((cWeapon != null) ? cWeapon.getItemId() : 0);

/*  264 */     Item weapon = equip.getItem((short) (second ? -10 : -11));
/*  265 */     mplew.writeInt((weapon != null) ? weapon.getItemId() : 0);

/*  267 */     Item subWeapon = equip.getItem((short)-10);
/*  268 */     mplew.writeInt((!zero && subWeapon != null) ? subWeapon.getItemId() : 0);


/*  271 */     mplew.writeInt(chr.isElfEar() ? 1 : 0);


/*  274 */     mplew.writeBool(false);
/*  275 */     mplew.writeInt(0);

/*  277 */     for (int i = 0; i < 3; i++) {
/*  278 */       mplew.writeInt((!second && chr.getSpawnPet(i) != null) ? chr.getSpawnPet(i).getPetItemId() : 0);
     }
/*  280 */     if (chr.hasDecorate()) {
/*  281 */       mplew.writeInt(chr.getDecorate());
     }
/*  283 */     if (zero) {
/*  284 */       mplew.write(second ? 1 : 0);
     }
/*  286 */     if (JobConstants.is林之灵(chr.getJob())) {
/*  287 */       chr.checkTailAndEar();
/*  288 */       mplew.write(Integer.valueOf(chr.getOneInfo(59300, "bEar")).intValue());
/*  289 */       mplew.writeInt(Integer.valueOf(chr.getOneInfo(59300, "EarID")).intValue());
/*  290 */       mplew.write(Integer.valueOf(chr.getOneInfo(59300, "bTail")).intValue());
/*  291 */       mplew.writeInt(Integer.valueOf(chr.getOneInfo(59300, "TailID")).intValue());
     }
/*  293 */     mplew.write(chr.getHairMixedColor());
/*  294 */     mplew.write(chr.getHairProbColor());
/*  295 */     mplew.writeZeroBytes(5);
   }

   public static void addExpirationTime(MaplePacketLittleEndianWriter mplew, long time) {
/*  299 */     mplew.writeLong(getTime(time));
   }

   public static void addItemPosition(MaplePacketLittleEndianWriter mplew, Item item, boolean trade, boolean bagSlot) {
/*  303 */     if (item == null) {
/*  304 */       mplew.write(0);
       return;
     }
/*  307 */     short pos = item.getPosition();
/*  308 */     if (pos <= -1) {
/*  309 */       pos = (short)(pos * -1);
/*  310 */       if (pos > 100 && pos < 1000) {
/*  311 */         pos = (short)(pos - 100);
       }
     }
/*  314 */     if (bagSlot) {
/*  315 */       mplew.writeInt(pos % 100 - 1);
/*  316 */     } else if (!trade && item.getType() == 1) {
/*  317 */       mplew.writeShort(pos);
     } else {
/*  319 */       mplew.write(pos);
     }
   }

   public static void addItemInfo(MaplePacketLittleEndianWriter mplew, Item item) {
/*  324 */     addItemInfo(mplew, item, null);
   }

   public static void addItemInfo(MaplePacketLittleEndianWriter mplew, Item item, MapleCharacter chr) {
/*  328 */     addItemInfo(mplew, item, chr, false);
   }

   public static void addItemInfo(MaplePacketLittleEndianWriter mplew, Item item, MapleCharacter chr, boolean active) {
/*  332 */     mplew.write((item.getPet() != null) ? 3 : item.getType());
/*  333 */     mplew.writeInt(item.getItemId());

/*  335 */     boolean hasUniqueId = (item.getUniqueId() > 0 && !ItemConstants.is结婚戒指(item.getItemId()) && item.getItemId() / 10000 != 166);
/*  336 */     mplew.write(hasUniqueId ? 1 : 0);
/*  337 */     if (hasUniqueId) {
/*  338 */       mplew.writeLong(item.getUniqueId());
     }
/*  340 */     if (item.getPet() != null) {
/*  341 */       addPetItemInfo(mplew, item, item.getPet(), active);
     } else {

/*  344 */       addExpirationTime(mplew, item.getExpiration());
/*  345 */       mplew.writeInt((chr == null) ? -1 : chr.getExtendedSlot(item.getType(), item.getItemId()));
/*  346 */       mplew.write(0);
/*  347 */       if (item.getType() == 1) {
/*  348 */         Equip equip = (Equip)item;
/*  349 */         addEquipStats(mplew, equip);
/*  350 */         addEquipBonusStats(mplew, equip, hasUniqueId);
       } else {
/*  352 */         mplew.writeShort(item.getQuantity());
/*  353 */         mplew.writeMapleAsciiString(item.getOwner());
/*  354 */         mplew.writeInt(item.getFlag());
/*  355 */         if (ItemConstants.is飞镖道具(item.getItemId()) || ItemConstants.is子弹道具(item.getItemId()) || item.getItemId() / 10000 == 287 || ItemConstants.isSetupExpRate(item.getItemId())) {
/*  356 */           mplew.writeLong(item.getInventoryId());
         }






/*  364 */         mplew.writeInt(0);
/*  365 */         int familiarid = ItemConstants.getFamiliarByItemID(item.getItemId());
/*  366 */         FamiliarCard fc = item.getFamiliarCard();
/*  367 */         mplew.writeInt(familiarid);
/*  368 */         mplew.writeShort((familiarid > 0 && fc != null) ? (short)fc.getLevel() : 0);
/*  369 */         mplew.writeShort((familiarid > 0 && fc != null) ? fc.getSkill() : 0);
/*  370 */         mplew.writeShort((familiarid > 0 && fc != null) ? (short)fc.getLevel() : 0);
/*  371 */         mplew.writeShort((familiarid > 0 && fc != null) ? fc.getOption(0) : 0);
/*  372 */         mplew.writeShort((familiarid > 0 && fc != null) ? fc.getOption(1) : 0);
/*  373 */         mplew.writeShort((familiarid > 0 && fc != null) ? fc.getOption(2) : 0);
/*  374 */         mplew.write((familiarid > 0 && fc != null) ? fc.getGrade() : 0);
       }
     }
   }




































   public static void addEquipStats(MaplePacketLittleEndianWriter mplew, Equip equip) {
/*  415 */     int flag = equip.getEquipFlag();
/*  416 */     mplew.writeInt(flag);
/*  417 */     if (EquipStats.可升级次数.check(flag)) {
/*  418 */       mplew.write(equip.getUpgradeSlots());
     }
/*  420 */     if (EquipStats.已升级次数.check(flag)) {
/*  421 */       mplew.write(equip.getLevel());
     }
/*  423 */     if (EquipStats.力量.check(flag)) {
/*  424 */       mplew.writeShort(equip.getStr());
     }
/*  426 */     if (EquipStats.敏捷.check(flag)) {
/*  427 */       mplew.writeShort(equip.getDex());
     }
/*  429 */     if (EquipStats.智力.check(flag)) {
/*  430 */       mplew.writeShort(equip.getInt());
     }
/*  432 */     if (EquipStats.运气.check(flag)) {
/*  433 */       mplew.writeShort(equip.getLuk());
     }
/*  435 */     if (EquipStats.Hp.check(flag)) {
/*  436 */       mplew.writeShort(equip.getHp());
     }
/*  438 */     if (EquipStats.Mp.check(flag)) {
/*  439 */       mplew.writeShort(equip.getMp());
     }
/*  441 */     if (EquipStats.物攻.check(flag)) {
/*  442 */       mplew.writeShort(equip.getWatk());
     }
/*  444 */     if (EquipStats.魔攻.check(flag)) {
/*  445 */       mplew.writeShort(equip.getMatk());
     }
/*  447 */     if (EquipStats.物防.check(flag)) {
/*  448 */       mplew.writeShort(equip.getWdef());
     }









/*  459 */     if (EquipStats.手技.check(flag)) {
/*  460 */       mplew.writeShort(equip.getHands());
     }
/*  462 */     if (EquipStats.速度.check(flag)) {
/*  463 */       mplew.writeShort(equip.getSpeed());
     }
/*  465 */     if (EquipStats.跳跃.check(flag)) {
/*  466 */       mplew.writeShort(equip.getJump());
     }
/*  468 */     if (EquipStats.状态.check(flag)) {
/*  469 */       mplew.writeInt(equip.getFlag());
     }
/*  471 */     if (EquipStats.技能.check(flag)) {
/*  472 */       mplew.writeBool((equip.getIncSkill() > 0));
     }
/*  474 */     if (equip.isSealedEquip()) {
/*  475 */       if (EquipStats.道具等级.check(flag)) {
/*  476 */         mplew.write(equip.getSealedLevel());
       }
/*  478 */       if (EquipStats.道具经验.check(flag)) {
/*  479 */         mplew.writeLong(equip.getSealedExp());
       }
     } else {
/*  482 */       if (EquipStats.道具等级.check(flag)) {
/*  483 */         mplew.write(Math.max(equip.getBaseLevel(), equip.getEquipLevel()));
       }
/*  485 */       if (EquipStats.道具经验.check(flag)) {
/*  486 */         mplew.writeLong(equip.getExpPercentage() * 100000L);
       }
     }
/*  489 */     if (EquipStats.耐久度.check(flag)) {
/*  490 */       mplew.writeInt(equip.getDurability());
     }
/*  492 */     if (EquipStats.金锤子.check(flag)) {
/*  493 */       mplew.writeInt(equip.getViciousHammer());
     }
/*  495 */     if (EquipStats.大乱斗攻击力.check(flag)) {
/*  496 */       mplew.writeShort(equip.getPVPDamage());
     }
/*  498 */     if (EquipStats.ENHANCT_BUFF.check(flag)) {
/*  499 */       mplew.writeShort(equip.getEnhanctBuff());
     }
/*  501 */     if (EquipStats.REQUIRED_LEVEL.check(flag)) {
/*  502 */       mplew.write(equip.getiIncReq());
     }
/*  504 */     if (EquipStats.YGGDRASIL_WISDOM.check(flag)) {
/*  505 */       mplew.write(equip.getYggdrasilWisdom());
     }
/*  507 */     if (EquipStats.FINAL_STRIKE.check(flag)) {
/*  508 */       mplew.writeBool(equip.getFinalStrike());
     }
/*  510 */     if (EquipStats.BOSS伤害.check(flag)) {
/*  511 */       mplew.write(equip.getBossDamage());
     }
/*  513 */     if (EquipStats.无视防御.check(flag)) {
/*  514 */       mplew.write(equip.getIgnorePDR());
     }





/*  521 */     int specialFlag = equip.getEquipSpecialFlag();
/*  522 */     mplew.writeInt(specialFlag);
/*  523 */     if (EquipStats.总伤害.check(specialFlag)) {
/*  524 */       mplew.write(equip.getTotalDamage());
     }
/*  526 */     if (EquipStats.全属性.check(specialFlag)) {
/*  527 */       mplew.write(equip.getAllStat());
     }
/*  529 */     if (EquipStats.剪刀次数.check(specialFlag)) {
/*  530 */       mplew.write(equip.getKarmaCount());
     }
/*  532 */     if (EquipStats.涅槃火焰.check(specialFlag)) {
/*  533 */       mplew.writeLong(equip.getFire());
     }
/*  535 */     if (EquipStats.星级.check(specialFlag)) {
/*  536 */       mplew.writeInt(equip.getItemState());
     }
   }


   public static void addEquipBonusStats(MaplePacketLittleEndianWriter mplew, Equip equip, boolean hasUniqueId) {
/*  542 */     mplew.writeMapleAsciiString(equip.getOwner());
/*  543 */     mplew.write((equip.getState(true) > 0 && equip.getState(true) < 17) ? (equip.getState(false) | 0x20) : equip.getState(false));
/*  544 */     mplew.write(equip.getEnhance());
/*  545 */     for (int i = 1; i <= 3; i++) {
/*  546 */       mplew.writeShort((equip.getPotential(i, false) <= 0) ? 0 : equip.getPotential(i, false));
     }
/*  548 */     for (int j = 1; j <= 3; j++) {
/*  549 */       mplew.writeShort((equip.getState(true) > 0 && equip.getState(true) < 17) ? ((j == 1) ? equip.getState(true) : 0) : equip.getPotential(j, true));
     }
/*  551 */     mplew.writeShort(equip.getItemSkin() % 10000);





/*  557 */     mplew.writeShort(equip.getSocketState());
/*  558 */     mplew.writeShort(equip.getSocket1() % 10000);
/*  559 */     mplew.writeShort(equip.getSocket2() % 10000);
/*  560 */     mplew.writeShort(equip.getSocket3() % 10000);
/*  561 */     mplew.writeInt(0);

/*  563 */     if (!hasUniqueId) {
/*  564 */       mplew.writeLong((equip.getInventoryId() <= 0L) ? equip.getEquipOnlyId() : equip.getInventoryId());
     }
/*  566 */     mplew.writeLong(getTime(-2L));
/*  567 */     mplew.writeInt(-1);
/*  568 */     mplew.writeLong(0L);
/*  569 */     mplew.writeLong(getTime(-2L));
/*  570 */     mplew.writeLong(0L);
/*  571 */     mplew.writeLong(0L);

/*  573 */     mplew.writeShort(equip.getSoulName());
/*  574 */     mplew.writeShort(equip.getSoulEnchanter());
/*  575 */     mplew.writeShort(equip.getSoulPotential());
/*  576 */     if (ItemConstants.isArcaneForce(equip.getItemId())) {
/*  577 */       mplew.writeShort(equip.getARC());
/*  578 */       mplew.writeInt(equip.getARCExp());
/*  579 */       mplew.writeShort(equip.getARCLevel());
     }

/*  582 */     mplew.writeShort(-1);
/*  583 */     mplew.writeLong(getTime(-1L));
/*  584 */     mplew.writeLong(getTime(-2L));
/*  585 */     mplew.writeLong(getTime(-1L));


/*  588 */     mplew.writeLong(equip.getLimitBreak());
   }










   public static void serializeMovementList(MaplePacketLittleEndianWriter lew, List<LifeMovementFragment> moves) {
/*  601 */     lew.write(moves.size());

/*  603 */     for (LifeMovementFragment move : moves) {
/*  604 */       move.serialize(lew);
     }
   }










   public static void serializeMovementList(MaplePacketLittleEndianWriter mplew, int v169, int tEncodedGatherDuration, Point startPos, Point velPos, List<LifeMovementFragment> moves) {
/*  618 */     mplew.writeInt(v169);
/*  619 */     mplew.writeInt(tEncodedGatherDuration);
/*  620 */     mplew.writePos(startPos);
/*  621 */     mplew.writePos(velPos);
/*  622 */     mplew.write(moves.size());
/*  623 */     for (LifeMovementFragment move : moves) {
/*  624 */       move.serialize(mplew);
     }
   }

   public static void addAnnounceBox(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/*  629 */     if (chr.getPlayerShop() != null && chr.getPlayerShop().isOwner(chr) && chr.getPlayerShop().getShopType() != 1 && chr.getPlayerShop().isAvailable()) {
/*  630 */       addInteraction(mplew, chr.getPlayerShop());
     } else {
/*  632 */       mplew.write(0);
     }
   }

   public static void addInteraction(MaplePacketLittleEndianWriter mplew, IMaplePlayerShop shop) {
/*  637 */     mplew.write(shop.getGameType());
/*  638 */     mplew.writeInt(((AbstractPlayerStore)shop).getObjectId());
/*  639 */     mplew.writeMapleAsciiString(shop.getDescription());
/*  640 */     if (shop.getShopType() != 1) {
/*  641 */       mplew.write((shop.getPassword().length() > 0) ? 1 : 0);
     }
/*  643 */     mplew.write((shop.getShopType() != 75) ? (shop.getItemId() % 100) : 0);
/*  644 */     mplew.write((shop.getShopType() != 75) ? shop.getSize() : 0);
/*  645 */     mplew.write(shop.getMaxSize());
/*  646 */     if (shop.getShopType() != 1) {
/*  647 */       mplew.write(shop.isOpen() ? 0 : 1);
     }
   }







   public static void addCharacterInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr, long mask) {
/*  658 */     mplew.writeLong(mask);

/*  660 */     mplew.write(0);
/*  661 */     for (int i = 0; i < 3; i++) {
/*  662 */       mplew.writeInt((JobConstants.is骑士团(chr.getJob()) || JobConstants.is米哈尔(chr.getJob())) ? -2 : -1);
     }
/*  664 */     if ((mask & 0x1L) != 0L) {
/*  665 */       mplew.writeZeroBytes(6);
/*  666 */       addCharStats(mplew, chr);
/*  667 */       mplew.write(chr.getBuddylist().getCapacity());

/*  669 */       if (chr.getBlessOfFairyOrigin() != null) {
/*  670 */         mplew.write(1);
/*  671 */         mplew.writeMapleAsciiString(chr.getBlessOfFairyOrigin());
       } else {
/*  673 */         mplew.write(0);
       }

/*  676 */       if (chr.getBlessOfEmpressOrigin() != null) {
/*  677 */         mplew.write(1);
/*  678 */         mplew.writeMapleAsciiString(chr.getBlessOfEmpressOrigin());
       } else {
/*  680 */         mplew.write(0);
       }

/*  683 */       MapleQuestStatus ultExplorer = chr.getQuestNoAdd(MapleQuest.getInstance(111111));
/*  684 */       if (ultExplorer != null && ultExplorer.getCustomData() != null) {
/*  685 */         mplew.write(1);
/*  686 */         mplew.writeMapleAsciiString(ultExplorer.getCustomData());
       } else {
/*  688 */         mplew.write(0);
       }


/*  692 */       mplew.writeInt(0);
/*  693 */       mplew.write(-1);
/*  694 */       mplew.writeInt(0);
/*  695 */       mplew.write(-1);
     }

/*  698 */     if ((mask & 0x2L) != 0L) {



/*  702 */       mplew.writeLong(chr.getMeso());
/*  703 */       mplew.writeInt(chr.getId());
/*  704 */       mplew.writeInt(chr.getBeans());
/*  705 */       mplew.writeInt(0);
     }

/*  708 */     if ((mask & 0x2000000L) != 0L && (mask & 0x8L) != 0L) {
/*  709 */       mplew.writeInt(0);
     }

/*  712 */     if ((mask >>> 32L & 0x4000000L) != 0L && (mask & 0x8L) != 0L) {
/*  713 */       mplew.writeInt((chr.getPotionPot() != null) ? 1 : 0);
/*  714 */       if (chr.getPotionPot() != null) {
/*  715 */         addPotionPotInfo(mplew, chr.getPotionPot());
       }
     }

/*  719 */     if ((mask & 0x80L) != 0L) {
/*  720 */       mplew.write(chr.getInventory(MapleInventoryType.EQUIP).getSlotLimit());
/*  721 */       mplew.write(chr.getInventory(MapleInventoryType.USE).getSlotLimit());
/*  722 */       mplew.write(chr.getInventory(MapleInventoryType.SETUP).getSlotLimit());
/*  723 */       mplew.write(chr.getInventory(MapleInventoryType.ETC).getSlotLimit());
/*  724 */       mplew.write(chr.getInventory(MapleInventoryType.CASH).getSlotLimit());
     }


/*  728 */     MapleQuestStatus stat = chr.getQuestNoAdd(MapleQuest.getInstance(122700));
/*  729 */     if (stat != null && stat.getCustomData() != null && Long.parseLong(stat.getCustomData()) > System.currentTimeMillis()) {
/*  730 */       mplew.writeLong(getTime(Long.parseLong(stat.getCustomData())));
     } else {
/*  732 */       mplew.writeLong(getTime(-2L));
     }

/*  735 */     mplew.write(0);

/*  737 */     MapleInventory iv = chr.getInventory(MapleInventoryType.EQUIPPED);
/*  738 */     List<Item> equippedList = iv.newList();
/*  739 */     Collections.sort(equippedList);
/*  740 */     List<Item> equipped = new ArrayList<>();
/*  741 */     List<Item> equippedCash = new ArrayList<>();
/*  742 */     List<Item> equippedDragon = new ArrayList<>();
/*  743 */     List<Item> equippedMechanic = new ArrayList<>();
/*  744 */     List<Item> equippedAndroid = new ArrayList<>();
/*  745 */     List<Item> equippedTotem = new ArrayList<>();
/*  746 */     List<Item> equippedLolitaCash = new ArrayList<>();
/*  747 */     List<Item> arrayList7 = new ArrayList<>();
/*  748 */     List<Item> equippedZeroGenderCash = new ArrayList<>();
/*  749 */     List<Item> equippedMystery = new ArrayList<>();
/*  750 */     List<Item> arrayList11 = new ArrayList<>();
/*  751 */     List<Item> arrayList12 = new ArrayList<>();

/*  753 */     for (Item item : equippedList) {
/*  754 */       if (item.getPosition() < 0 && item.getPosition() > -100) {
/*  755 */         equipped.add(item); continue;
/*  756 */       }  if (item.getPosition() <= -100 && item.getPosition() > -1000) {
/*  757 */         equippedCash.add(item); continue;
/*  758 */       }  if (item.getPosition() <= -1000 && item.getPosition() > -1100) {
/*  759 */         equippedDragon.add(item); continue;
/*  760 */       }  if (item.getPosition() <= -1100 && item.getPosition() > -1200) {
/*  761 */         equippedMechanic.add(item); continue;
/*  762 */       }  if (item.getPosition() <= -1200 && item.getPosition() > -1300) {
/*  763 */         equippedAndroid.add(item); continue;
/*  764 */       }  if (item.getPosition() <= -1300 && item.getPosition() > -1306) {
/*  765 */         equippedLolitaCash.add(item); continue;
/*  766 */       }  if (item.getPosition() <= -1400 && item.getPosition() > -1500) {
/*  767 */         arrayList7.add(item); continue;
/*  768 */       }  if (item.getPosition() <= -1500 && item.getPosition() > -1600) {
/*  769 */         equippedZeroGenderCash.add(item); continue;
/*  770 */       }  if (item.getPosition() <= -1600 && item.getPosition() > -1606) {
/*  771 */         equippedMystery.add(item); continue;
/*  772 */       }  if (item.getPosition() <= -5000 && item.getPosition() > -5003) {
/*  773 */         equippedTotem.add(item); continue;
/*  774 */       }  if (item.getPosition() == -5200) {
/*  775 */         arrayList11.add(item); continue;
/*  776 */       }  if (item.getPosition() <= -6000 && item.getPosition() > -6200) {
/*  777 */         chr.getSkillSkin().put(Integer.valueOf(MapleItemInformationProvider.getInstance().getSkillSkinFormSkillId(item.getItemId())), Integer.valueOf(item.getItemId()));
/*  778 */         arrayList12.add(item);
       }
     }

/*  782 */     for (Item item : equipped) {
/*  783 */       addItemPosition(mplew, item, false, false);
/*  784 */       addItemInfo(mplew, item, chr);
     }
/*  786 */     mplew.writeShort(0);

/*  788 */     for (Item item : equippedCash) {
/*  789 */       addItemPosition(mplew, item, false, false);
/*  790 */       addItemInfo(mplew, item, chr);
     }
/*  792 */     mplew.writeShort(0);

/*  794 */     iv = chr.getInventory(MapleInventoryType.EQUIP);
/*  795 */     ArrayList<Item> items21000 = new ArrayList<>();
/*  796 */     for (Item item : iv.list()) {
/*  797 */       if (item.getPosition() >= 21000) {
/*  798 */         items21000.add(item); continue;
       }
/*  800 */       addItemPosition(mplew, item, false, false);
/*  801 */       addItemInfo(mplew, item, chr);
     }

/*  804 */     mplew.writeShort(0);
/*  805 */     for (Item item : equippedDragon) {
/*  806 */       addItemPosition(mplew, item, false, false);
/*  807 */       addItemInfo(mplew, item, chr);
     }
/*  809 */     mplew.writeShort(0);
/*  810 */     for (Item item : equippedMechanic) {
/*  811 */       addItemPosition(mplew, item, false, false);
/*  812 */       addItemInfo(mplew, item, chr);
     }
/*  814 */     mplew.writeShort(0);
/*  815 */     for (Item item : equippedAndroid) {
/*  816 */       addItemPosition(mplew, item, false, false);
/*  817 */       addItemInfo(mplew, item, chr);
     }
/*  819 */     mplew.writeShort(0);
/*  820 */     for (Item item : equippedTotem) {
/*  821 */       addItemPosition(mplew, item, false, false);
/*  822 */       addItemInfo(mplew, item, chr);
     }
/*  824 */     mplew.writeShort(0);
/*  825 */     for (Item item : equippedLolitaCash) {
/*  826 */       addItemPosition(mplew, item, false, false);
/*  827 */       addItemInfo(mplew, item, chr);
     }
/*  829 */     mplew.writeShort(0);
/*  830 */     mplew.writeShort(0);
/*  831 */     equippedZeroGenderCash.forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  835 */     mplew.writeShort(0);
/*  836 */     mplew.writeShort(0);
/*  837 */     equippedMystery.forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  841 */     mplew.writeShort(0);
/*  842 */     arrayList12.forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  846 */     mplew.writeShort(0);
/*  847 */     mplew.writeShort(0);
/*  848 */     arrayList11.forEach(item -> {
           addItemPosition(mplew, item, false, false);

           addItemInfo(mplew, item, chr);
         });
/*  853 */     mplew.writeShort(0);
/*  854 */     items21000.forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  858 */     mplew.writeShort(0);
/*  859 */     mplew.writeShort(0);
/*  860 */     mplew.writeShort(0);
/*  861 */     mplew.writeShort(0);
/*  862 */     mplew.writeShort(0);

/*  864 */     iv = chr.getInventory(MapleInventoryType.USE);
/*  865 */     iv.list().stream().filter(item -> (item.getPosition() < 129)).forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  869 */     mplew.write(0);
/*  870 */     iv = chr.getInventory(MapleInventoryType.SETUP);
/*  871 */     iv.list().stream().filter(item -> (item.getPosition() < 129)).forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  875 */     mplew.write(0);
/*  876 */     iv = chr.getInventory(MapleInventoryType.ETC);
/*  877 */     iv.list().stream().filter(item -> (item.getPosition() < 129))
/*  878 */       .forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  882 */     mplew.write(0);
/*  883 */     iv = chr.getInventory(MapleInventoryType.CASH);
/*  884 */     iv.list().forEach(item -> {
           addItemPosition(mplew, item, false, false);
           addItemInfo(mplew, item, chr);
         });
/*  888 */     mplew.write(0);

    Arrays.asList(MapleInventoryType.USE, MapleInventoryType.SETUP, MapleInventoryType.ETC)
            .forEach(invtype -> {
                int size = chr.getExtendedSlots(invtype.getType()).size();
                mplew.writeInt(size);
                for (int i = 0; i < size; i++) {
                    mplew.writeInt(i);
                    mplew.writeInt(chr.getExtendedSlots(invtype.getType()).get(i));
                    int finalI = i;
                    chr.getInventory(MapleInventoryType.ETC).list().stream()
                            .filter(item -> item.getPosition() > (finalI * 100 + 10000) && item.getPosition() < (finalI * 100 + 20000))
                            .forEach(item -> {
                                addItemPosition(mplew, item, false, true);
                                addItemInfo(mplew, item, chr);
                            });
                    mplew.writeInt(-1);
                }
            });
/*  908 */     mplew.writeZeroBytes(9);




















/*  929 */     if ((mask & 0x100L) != 0L) {
/*  930 */       addSkillInfo(mplew, chr);
/*  931 */       addLinkSkillInfo(mplew, chr);
/*  932 */       addSonOfLinkedSkillInfo(mplew, chr);
     }





/*  939 */     if ((mask & 0x8000L) != 0L) {
/*  940 */       addCooldownsInfo(mplew, chr);
     }




/*  946 */     if ((mask & 0x200L) != 0L) {
/*  947 */       addQuestStatusInfo(mplew, chr);
     }

/*  950 */     if ((mask & 0x4000L) != 0L) {
/*  951 */       addQuestCompletedInfo(mplew, chr);
     }

/*  954 */     if ((mask & 0x400L) != 0L) {
/*  955 */       mplew.writeShort(0);
     }




/*  961 */     if ((mask & 0x800L) != 0L) {
/*  962 */       addRingsInfo(mplew, chr);
     }




/*  968 */     if ((mask & 0x1000L) != 0L) {
/*  969 */       addRocksInfo(mplew, chr);
     }






/*  977 */     Map<Integer, String> questInfos = new LinkedHashMap<>();
/*  978 */     Map<Integer, String> questInfos_share = new LinkedHashMap<>();
/*  979 */     for (Map.Entry<Integer, String> quest : (Iterable<Map.Entry<Integer, String>>)chr.getInfoQuest_Map().entrySet()) {
/*  980 */       if (GameConstants.isShareQuestInfo(((Integer)quest.getKey()).intValue())) {
/*  981 */         questInfos_share.put(quest.getKey(), quest.getValue()); continue;
       }
/*  983 */       questInfos.put(quest.getKey(), quest.getValue());
     }


/*  987 */     if ((mask & 0x40000L) != 0L) {
/*  988 */       mplew.writeShort(questInfos.size());
/*  989 */       for (Map.Entry<Integer, String> quest : questInfos.entrySet()) {
/*  990 */         mplew.writeInt(((Integer)quest.getKey()).intValue());
/*  991 */         mplew.writeMapleAsciiString((quest.getValue() == null) ? "" : quest.getValue());
       }
     }

/*  995 */     if ((mask & 0x200000000000L) != 0L) {
/*  996 */       mplew.writeShort(0);
     }

/*  999 */     if ((mask & 0x80000L) != 0L) {
/* 1000 */       mplew.writeShort(0);
     }

/* 1003 */     mplew.write(1);

/* 1005 */     mplew.writeInt(0);
/* 1006 */     mplew.writeInt(0);

/* 1008 */     if ((mask & 0x200000L) != 0L) {
/* 1009 */       addJaguarInfo(mplew, chr);
     }

/* 1012 */     if ((mask & 0x80000000000L) != 0L && 
/* 1013 */       JobConstants.is神之子(chr.getJob())) {
/* 1014 */       chr.getStat().zeroData(mplew, chr);
     }


/* 1018 */     if ((mask & 0x4000000L) != 0L) {



















/* 1038 */       int size = 0;
/* 1039 */       mplew.writeShort(size);
/* 1040 */       for (int m = 0; m < size; m++) {
/* 1041 */         int sizes = 0;
/* 1042 */         mplew.writeShort(sizes);
/* 1043 */         mplew.writeInt(0);
/* 1044 */         for (int n = 0; n < sizes; n++) {
/* 1045 */           mplew.writeInt(0);
/* 1046 */           mplew.writeShort(0);
/* 1047 */           mplew.writeInt(0);
/* 1048 */           mplew.writeShort(0);
/* 1049 */           mplew.writeLong(0L);
         }
       }
/* 1052 */       mplew.writeShort(0);
     }

/* 1055 */     if ((mask & 0x20000000L) != 0L)
     {
/* 1057 */       for (int m = 0; m < 15; m++) {
/* 1058 */         mplew.writeInt(chr.getStealMemorySkill(m));
       }
     }
/* 1061 */     if ((mask & 0x10000000L) != 0L) {

/* 1063 */       int[] p_skills = { 24001001, 24101001, 24111001, 24121001, 24121054 };
/* 1064 */       for (int m : p_skills) {
/* 1065 */         mplew.writeInt(chr.获取幻影装备技能(m));
       }
     }

/* 1069 */     if ((mask & 0xFFFFFFFF80000000L) != 0L) {
/* 1070 */       addInnerSkillInfo(mplew, chr);
     }

/* 1073 */     if ((mask & 0x1000000000000L) != 0L) {
/* 1074 */       mplew.writeShort(0);
     }

/* 1077 */     if ((mask & 0x100000000L) != 0L) {
/* 1078 */       mplew.writeInt(1);
/* 1079 */       mplew.writeInt(chr.getHonor());
     }

/* 1082 */     if ((mask & 0x200000000L) != 0L) {
/* 1083 */       mplew.write(1);
/* 1084 */       mplew.writeShort(0);
     }

/* 1087 */     if ((mask & 0x400000000L) != 0L) {
/* 1088 */       mplew.write(0);
     }

/* 1091 */     if ((mask & 0x800000000L) != 0L) {
/* 1092 */       writeDressUpInfo(mplew, chr);
     }
/* 1094 */     if ((mask & 0x20000000000000L) != 0L) {
/* 1095 */       mplew.writeInt(0);
/* 1096 */       mplew.writeInt(0);
/* 1097 */       mplew.writeLong(getTime(-2L));
     }

/* 1100 */     if ((mask & 0x1000000000L) != 0L) {
/* 1101 */       mplew.writeShort(0);
/* 1102 */       mplew.writeShort(0);
     }

/* 1105 */     if ((mask & 0x8000000000L) != 0L) {
/* 1106 */       mplew.write(0);
     }

/* 1109 */     mplew.writeLong(0L);
/* 1110 */     mplew.writeLong(0L);
/* 1111 */     mplew.writeLong(0L);

/* 1113 */     if ((mask & 0x40000000000L) != 0L) {
/* 1114 */       mplew.writeInt(chr.getLove());
/* 1115 */       mplew.writeLong(getTime(-2L));
/* 1116 */       mplew.writeInt(0);
     }

/* 1119 */     if ((mask & 0x2000000000000L) != 0L) {

/* 1121 */       mplew.writeInt(chr.getId());
/* 1122 */       mplew.writeZeroBytes(12);
/* 1123 */       mplew.writeLong(getTime(-2L));
/* 1124 */       mplew.writeInt(10);
     }

/* 1127 */     if ((mask & 0x8000000000000L) != 0L) {
/* 1128 */       mplew.writeInt(0);
/* 1129 */       mplew.writeInt(0);
/* 1130 */       mplew.writeLong(0L);
/* 1131 */       mplew.writeInt(100);
     }




/* 1137 */     mplew.writeShort(questInfos_share.size());
/* 1138 */     for (Map.Entry<Integer, String> quest : questInfos_share.entrySet()) {
/* 1139 */       mplew.writeInt(((Integer)quest.getKey()).intValue());
/* 1140 */       mplew.writeMapleAsciiString((quest.getValue() == null) ? "" : quest.getValue());
     }

/* 1143 */     if ((mask & 0x4000000000000L) != 0L)
     {
/* 1145 */       mplew.writeShort(0);
     }

/* 1148 */     mplew.write(0);
/* 1149 */     mplew.writeInt(0);

/* 1151 */     if ((mask & 0x10000000000000L) != 0L) {
/* 1152 */       mplew.writeShort(0);
     }

/* 1155 */     if ((mask & 0x20000000000000L) != 0L)
     {
/* 1157 */       VCorePacket.INSTANCE.writeVCoreSkillData(mplew, chr);
     }



/* 1162 */     if ((mask & 0x40000000000000L) != 0L) {
/* 1163 */       mplew.writeInt(chr.getClient().getAccID());
/* 1164 */       mplew.writeInt(chr.getId());
/* 1165 */       mplew.writeInt(0);
/* 1166 */       mplew.writeLong(getTime(-2L));
/* 1167 */       mplew.writeLong(0L);
/* 1168 */       mplew.writeLong(0L);


/* 1171 */       int unk_149s = 0;

/* 1173 */       mplew.writeInt(unk_149s);
/* 1174 */       for (int m = 0; m < unk_149s; m++) {

/* 1176 */         mplew.writeInt(0);
/* 1177 */         mplew.write(0);
/* 1178 */         mplew.write(0);
/* 1179 */         mplew.writeLong(0L);
/* 1180 */         mplew.writeMapleAsciiString("");
       }
     }

/* 1184 */     int unk_1 = 0;
/* 1185 */     mplew.writeInt(unk_1);
/* 1186 */     for (int j = 0; j < unk_1; j++) {
/* 1187 */       mplew.writeInt(1);
/* 1188 */       mplew.writeInt(1);
/* 1189 */       mplew.write(0);
/* 1190 */       mplew.writeLong(0L);
     }

/* 1193 */     int unk_2 = 0;
/* 1194 */     mplew.writeInt(unk_2);
/* 1195 */     for (int k = 0; k < unk_2; k++) {
/* 1196 */       mplew.writeInt(1);
/* 1197 */       mplew.writeInt(1);
/* 1198 */       mplew.writeInt(1);
/* 1199 */       mplew.writeInt(1);
/* 1200 */       mplew.writeInt(1);
/* 1201 */       mplew.writeInt(1);
/* 1202 */       mplew.writeInt(1);
     }

/* 1205 */     mplew.writeShort(0);
/* 1206 */     mplew.write(0);
/* 1207 */     mplew.writeInt(0);
/* 1208 */     mplew.writeInt(0);
/* 1209 */     mplew.writeShort(0);
/* 1210 */     mplew.write(0);
























/* 1235 */     mplew.writeHexString("27 00 00 00 91 BD 98 00 91 BD 98 00 00 40 E0 FD 3B 37 4F 01 00 00 92 BD 98 00 92 BD 98 00 00 40 E0 FD 3B 37 4F 01 00 00 93 BD 98 00 93 BD 98 00 00 40 E0 FD 3B 37 4F 01 00 00 94 BD 98 00 94 BD 98 00 00 40 E0 FD 3B 37 4F 01 00 00 95 BD 98 00 95 BD 98 00 00 40 E0 FD 3B 37 4F 01 00 00 96 BD 98 00 96 BD 98 00 00 40 E0 FD 3B 37 4F 01 00 00 F5 A7 99 00 F5 A7 99 00 00 40 E0 FD 3B 37 4F 01 00 00 F1 A7 99 00 F1 A7 99 00 00 40 E0 FD 3B 37 4F 01 00 00 F2 A7 99 00 F2 A7 99 00 00 40 E0 FD 3B 37 4F 01 00 00 F3 A7 99 00 F3 A7 99 00 00 40 E0 FD 3B 37 4F 01 00 00 F4 A7 99 00 F4 A7 99 00 00 40 E0 FD 3B 37 4F 01 00 00 81 96 98 00 81 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 82 96 98 00 82 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 83 96 98 00 83 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 84 96 98 00 84 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 85 96 98 00 85 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 86 96 98 00 86 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 87 96 98 00 87 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 88 96 98 00 88 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 89 96 98 00 89 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 8A 96 98 00 8A 96 98 00 00 40 E0 FD 3B 37 4F 01 00 00 A1 E4 98 00 A1 E4 98 00 00 40 E0 FD 3B 37 4F 01 00 00 A2 E4 98 00 A2 E4 98 00 00 40 E0 FD 3B 37 4F 01 00 00 A3 E4 98 00 A3 E4 98 00 00 40 E0 FD 3B 37 4F 01 00 00 A4 E4 98 00 A4 E4 98 00 00 40 E0 FD 3B 37 4F 01 00 00 B2 0B 99 00 B2 0B 99 00 00 40 E0 FD 3B 37 4F 01 00 00 B1 0B 99 00 B1 0B 99 00 00 40 E0 FD 3B 37 4F 01 00 00 B3 0B 99 00 B3 0B 99 00 00 40 E0 FD 3B 37 4F 01 00 00 B5 0B 99 00 B5 0B 99 00 00 40 E0 FD 3B 37 4F 01 00 00 B4 0B 99 00 B4 0B 99 00 00 40 E0 FD 3B 37 4F 01 00 00 B6 0B 99 00 B6 0B 99 00 00 40 E0 FD 3B 37 4F 01 00 00 D1 59 99 00 D1 59 99 00 00 40 E0 FD 3B 37 4F 01 00 00 D2 59 99 00 D2 59 99 00 00 40 E0 FD 3B 37 4F 01 00 00 D3 59 99 00 D3 59 99 00 00 40 E0 FD 3B 37 4F 01 00 00 D4 59 99 00 D4 59 99 00 00 40 E0 FD 3B 37 4F 01 00 00 E1 80 99 00 E1 80 99 00 00 40 E0 FD 3B 37 4F 01 00 00 E2 80 99 00 E2 80 99 00 00 40 E0 FD 3B 37 4F 01 00 00 E4 80 99 00 E4 80 99 00 00 40 E0 FD 3B 37 4F 01 00 00 E3 80 99 00 E3 80 99 00 00 40 E0 FD 3B 37 4F 01 00 00");








/* 1244 */     mplew.writeHexString("07 00 00 00 01 00 E9 03 00 00 02 00 EF 03 00 00 03 00 E8 03 00 00 04 00 EA 03 00 00 05 00 EB 03 00 00 06 00 ED 03 00 00 07 00 EE 03 00 00 ");

/* 1246 */     mplew.writeShort(8);
/* 1247 */     mplew.writeInt(0);
/* 1248 */     mplew.writeInt(0);



/* 1252 */     if ((mask & 0x800000000000000L) != 0L) {
/* 1253 */       mplew.write(1);
/* 1254 */       String string = chr.getOneInfo(17008, "T");
/* 1255 */       String string2 = chr.getOneInfo(17008, "L");
/* 1256 */       String string3 = chr.getOneInfo(17008, "E");
/* 1257 */       mplew.write((string == null) ? 0 : Integer.valueOf(string).intValue());
/* 1258 */       mplew.writeInt((string2 == null) ? 1 : Integer.valueOf(string2).intValue());
/* 1259 */       mplew.writeInt((string3 == null) ? 0 : Integer.valueOf(string3).intValue());
/* 1260 */       mplew.writeInt(100 - chr.getPQLog("航海能量"));
/* 1261 */       mplew.writeLong(getTime(-2L));

/* 1263 */       String questinfo = chr.getInfoQuest(17018);
/* 1264 */       String[] questinfos = questinfo.split(";");
/* 1265 */       mplew.writeShort(!questinfo.isEmpty() ? questinfos.length : 0);
/* 1266 */       for (String questinfo1 : questinfos) {
/* 1267 */         if (!questinfo1.isEmpty()) {
/* 1268 */           String[] split = questinfo1.split("=");
/* 1269 */           mplew.write(Integer.valueOf(split[0]).intValue());
/* 1270 */           mplew.writeInt(Integer.valueOf(split[1]).intValue());
/* 1271 */           mplew.writeInt(0);
         }
       }
/* 1274 */       mplew.writeShort(ItemConstants.航海材料.length);
/* 1275 */       for (int m : ItemConstants.航海材料) {
/* 1276 */         mplew.writeInt(m);
/* 1277 */         mplew.writeInt(chr.getPQLog(String.valueOf(m)));
/* 1278 */         mplew.writeLong(getTime(System.currentTimeMillis()));
       }
     }



/* 1284 */     if ((mask & 0x1000000000000000L) != 0L) {
/* 1285 */       mplew.write(0);
     }

/* 1288 */     if ((mask & 0x2000000000000000L) != 0L) {
/* 1289 */       mplew.writeInt(0);
/* 1290 */       mplew.writeInt(0);
     }

/* 1293 */     if ((mask & 0x40000000000000L) != 0L) {
/* 1294 */       addCoreAura(mplew, chr);
     }

/* 1297 */     if ((mask & 0x80000000000000L) != 0L) {
/* 1298 */       mplew.writeShort(0);
     }

/* 1301 */     if ((mask & 0x100000000000000L) != 0L) {
/* 1302 */       mplew.writeShort(0);
     }

/* 1305 */     if ((mask & 0x200000000000000L) != 0L) {
/* 1306 */       addRedLeafInfo(mplew, chr);
     }
/* 1308 */     if ((mask & 0x4000000000000000L) != 0L) {
/* 1309 */       mplew.write(0);
     }

/* 1312 */     if ((mask & 0x4000000000000000L) != 0L) {
/* 1313 */       mplew.write(0);
     }
/* 1315 */     if ((mask & Long.MIN_VALUE) != 0L) {
/* 1316 */       mplew.writeInt(0);
/* 1317 */       mplew.writeInt(0);
/* 1318 */       mplew.writeInt(0);
/* 1319 */       mplew.writeInt(0);
/* 1320 */       mplew.writeShort(0);






/* 1327 */       mplew.writeShort(0);
     }







/* 1336 */     mplew.writeLong(getTime(-2L));
/* 1337 */     mplew.writeShort(0);
/* 1338 */     mplew.write(1);
   }

   public static void addSkillInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1342 */     Map<Integer, SkillEntry> skills = chr.getSkills(true);
/* 1343 */     mplew.write(1);
/* 1344 */     mplew.writeShort(skills.size());
/* 1345 */     for (Map.Entry<Integer, SkillEntry> skillinfo : skills.entrySet()) {






/* 1352 */       Skill skill = SkillFactory.getSkill(((Integer)skillinfo.getKey()).intValue());
/* 1353 */       mplew.writeInt(skill.getId());
/* 1354 */       if (skill.isLinkSkills()) {
/* 1355 */         mplew.writeInt(((SkillEntry)skillinfo.getValue()).teachId);
/* 1356 */       } else if (skill.isTeachSkills()) {
/* 1357 */         mplew.writeInt((((SkillEntry)skillinfo.getValue()).teachId > 0) ? ((SkillEntry)skillinfo.getValue()).teachId : chr.getId());
       } else {
/* 1359 */         mplew.writeInt(((SkillEntry)skillinfo.getValue()).skillevel);
       }
/* 1361 */       addExpirationTime(mplew, ((SkillEntry)skillinfo.getValue()).expiration);
/* 1362 */       if (SkillConstants.isFourthJob(skill.getId())) {
/* 1363 */         mplew.writeInt(((SkillEntry)skillinfo.getValue()).masterlevel);
       }
     }
   }







   public static void addLinkSkillInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1375 */     Map<Integer, SkillEntry> teachList = chr.getLinkSkills();
/* 1376 */     mplew.writeShort(teachList.size());
/* 1377 */     for (Map.Entry<Integer, SkillEntry> skill : teachList.entrySet()) {
/* 1378 */       mplew.writeInt(((Integer)skill.getKey()).intValue());
/* 1379 */       mplew.writeShort(((SkillEntry)skill.getValue()).skillevel - 1);
     }
   }

   public static void addSonOfLinkedSkillInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1384 */     Map<Integer, Pair<Integer, SkillEntry>> sonOfLinkedSkills = chr.getSonOfLinkedSkills();
/* 1385 */     mplew.writeInt(sonOfLinkedSkills.size());
/* 1386 */     for (Map.Entry<Integer, Pair<Integer, SkillEntry>> entry : sonOfLinkedSkills.entrySet()) {
/* 1387 */       writeSonOfLinkedSkill(mplew, ((Integer)entry.getKey()).intValue(), entry.getValue());
     }
   }

   public static void addCooldownsInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1392 */     List<MapleCoolDownValueHolder> cooldowns = chr.getCooldowns();
/* 1393 */     mplew.writeShort(cooldowns.size());
/* 1394 */     for (MapleCoolDownValueHolder cooling : cooldowns) {
/* 1395 */       mplew.writeInt(cooling.skillId);
/* 1396 */       int timeLeft = (int)(cooling.length + cooling.startTime - System.currentTimeMillis());
/* 1397 */       mplew.writeInt(timeLeft / 1000);
     }
   }


   public static void addQuestStatusInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1403 */     List<MapleQuestStatus> started = chr.getStartedQuests();
/* 1404 */     mplew.write(1);
/* 1405 */     mplew.writeShort(started.size());
/* 1406 */     for (MapleQuestStatus q : started) {
/* 1407 */       mplew.writeInt(q.getQuest().getId());

/* 1409 */       if (q.hasMobKills()) {
/* 1410 */         StringBuilder sb = new StringBuilder();
/* 1411 */         for (Iterator<Integer> iterator = q.getMobKills().values().iterator(); iterator.hasNext(); ) { int kills = ((Integer)iterator.next()).intValue();
/* 1412 */           sb.append(StringUtil.getLeftPaddedStr(String.valueOf(kills), '0', 3)); }

/* 1414 */         mplew.writeMapleAsciiString(sb.toString()); continue;
       }
/* 1416 */       mplew.writeMapleAsciiString((q.getCustomData() == null) ? "" : q.getCustomData());
     }
   }


   public static void addQuestCompletedInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1422 */     mplew.write(1);
/* 1423 */     List<MapleQuestStatus> completed = chr.getCompletedQuests();
/* 1424 */     mplew.writeShort(completed.size());
/* 1425 */     for (MapleQuestStatus q : completed) {
/* 1426 */       mplew.writeInt(q.getQuest().getId());

/* 1428 */       mplew.writeLong(DateUtil.getTime(q.getCompletionTime()));
     }
   }

   public static void addRingsInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1433 */     Triple<List<MapleRing>, List<MapleRing>, List<MapleRing>> aRing = chr.getRings(true);

/* 1435 */     List<MapleRing> cRing = (List<MapleRing>)aRing.getLeft();
/* 1436 */     mplew.writeShort(cRing.size());
/* 1437 */     for (MapleRing ring : cRing) {
/* 1438 */       mplew.writeInt(ring.getPartnerChrId());
/* 1439 */       mplew.writeAsciiString(ring.getPartnerName(), 13);
/* 1440 */       mplew.writeLong(ring.getRingId());
/* 1441 */       mplew.writeLong(ring.getPartnerRingId());
     }

/* 1444 */     List<MapleRing> fRing = (List<MapleRing>)aRing.getMid();
/* 1445 */     mplew.writeShort(fRing.size());
/* 1446 */     for (MapleRing ring : fRing) {
/* 1447 */       mplew.writeInt(ring.getPartnerChrId());
/* 1448 */       mplew.writeAsciiString(ring.getPartnerName(), 13);
/* 1449 */       mplew.writeLong(ring.getRingId());
/* 1450 */       mplew.writeLong(ring.getPartnerRingId());
/* 1451 */       mplew.writeInt(ring.getItemId());
     }

/* 1454 */     List<MapleRing> mRing = (List<MapleRing>)aRing.getRight();
/* 1455 */     mplew.writeShort(mRing.size());
/* 1456 */     for (MapleRing ring : mRing) {
/* 1457 */       mplew.writeInt(chr.getMarriageId());
/* 1458 */       mplew.writeInt(chr.getId());
/* 1459 */       mplew.writeInt(ring.getPartnerChrId());
/* 1460 */       mplew.writeShort(3);
/* 1461 */       mplew.writeInt(ring.getItemId());
/* 1462 */       mplew.writeInt(ring.getItemId());
/* 1463 */       mplew.writeAsciiString(chr.getName(), 13);
/* 1464 */       mplew.writeAsciiString(ring.getPartnerName(), 13);
     }
   }

   public static void addRocksInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1469 */     int[] mapz = chr.getRegRocks();
/* 1470 */     for (int i = 0; i < 5; i++) {
/* 1471 */       mplew.writeInt(mapz[i]);
     }
/* 1473 */     int[] map = chr.getRocks();
/* 1474 */     for (int j = 0; j < 10; j++) {
/* 1475 */       mplew.writeInt(map[j]);
     }
/* 1477 */     int[] maps = chr.getHyperRocks();
/* 1478 */     for (int k = 0; k < 13; k++) {
/* 1479 */       mplew.writeInt(maps[k]);
     }
   }


   public static void addRedLeafInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1485 */     int[] idarr = { 9410165, 9410166, 9410167, 9410168, 9410198 };
/* 1486 */     mplew.writeInt(chr.getClient().getAccID());
/* 1487 */     mplew.writeInt(chr.getId());
/* 1488 */     mplew.writeLong(idarr.length);
/* 1489 */     for (int i = 0; i < idarr.length; i++) {
/* 1490 */       mplew.writeInt(idarr[i]);
/* 1491 */       mplew.writeInt(chr.getFriendShipPoints()[i]);
     }
   }




   public static void addCoreAura(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1499 */     MapleCoreAura aura = chr.getCoreAura();
/* 1500 */     if (aura != null) {
/* 1501 */       mplew.writeInt(chr.getId());
/* 1502 */       mplew.writeInt(aura.getId());
/* 1503 */       mplew.writeInt(aura.getLevel());
/* 1504 */       mplew.writeInt(aura.getCoreAuraLevel());
/* 1505 */       mplew.writeInt(aura.getTotal());
/* 1506 */       mplew.writeInt(aura.getWatk());
/* 1507 */       mplew.writeInt(aura.getDex());
/* 1508 */       mplew.writeInt(aura.getLuk());
/* 1509 */       mplew.writeInt(aura.getMagic());
/* 1510 */       mplew.writeInt(aura.getInt());
/* 1511 */       mplew.writeInt(aura.getStr());
/* 1512 */       mplew.writeInt(5);
/* 1513 */       mplew.writeInt(32);
/* 1514 */       mplew.writeInt(18);
/* 1515 */       mplew.writeInt(68);
/* 1516 */       mplew.writeLong(getTime(aura.getExpiration()));
     } else {
/* 1518 */       mplew.writeZeroBytes(60);
/* 1519 */       mplew.writeLong(getTime(System.currentTimeMillis()));
     }
/* 1521 */     mplew.write(0);
/* 1522 */     mplew.writeBool(JobConstants.canUseFamiliar(chr.getJob()));
   }

   public static void addMonsterBookInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1526 */     mplew.writeInt(0);
/* 1527 */     if (chr.getMonsterBook().getSetScore() > 0) {
/* 1528 */       chr.getMonsterBook().writeFinished(mplew);
     } else {
/* 1530 */       chr.getMonsterBook().writeUnfinished(mplew);
     }
/* 1532 */     mplew.writeInt(chr.getMonsterBook().getSet());
/* 1533 */     mplew.writeZeroBytes(9);
   }














   public static void addPetItemInfo(MaplePacketLittleEndianWriter mplew, Item item, MaplePet pet, boolean active) {
/* 1550 */     if (item == null) {
/* 1551 */       mplew.writeLong(getKoreanTimestamp((long)(System.currentTimeMillis() * 1.5D)));
     } else {
/* 1553 */       addExpirationTime(mplew, (item.getExpiration() <= System.currentTimeMillis()) ? -1L : item.getExpiration());
     }
/* 1555 */     mplew.writeInt(-1);
/* 1556 */     mplew.write(0);
/* 1557 */     mplew.writeAsciiString(pet.getName(), 13);
/* 1558 */     mplew.write(pet.getLevel());
/* 1559 */     mplew.writeShort(pet.getCloseness());
/* 1560 */     mplew.write(pet.getFullness());
/* 1561 */     if (item == null) {
/* 1562 */       mplew.writeLong(getKoreanTimestamp((long)(System.currentTimeMillis() * 1.5D)));
     } else {
/* 1564 */       addExpirationTime(mplew, (item.getExpiration() <= System.currentTimeMillis()) ? -1L : item.getExpiration());
     }
/* 1566 */     mplew.writeShort(0);
/* 1567 */     mplew.writeShort(pet.getFlags());
/* 1568 */     mplew.writeInt((pet.getPetItemId() == 5000054 && pet.getSecondsLeft() > 0) ? pet.getSecondsLeft() : 0);
/* 1569 */     mplew.writeShort(pet.isCanPickup() ? 0 : 2);
/* 1570 */     mplew.write(active ? (pet.getSummoned() ? pet.getSummonedValue() : 0) : 0);
/* 1571 */     mplew.writeInt(active ? pet.getBuffSkill() : 0);
/* 1572 */     mplew.writeInt(pet.getColor());
/* 1573 */     mplew.writeShort(100);
/* 1574 */     mplew.writeShort(0);
/* 1575 */     mplew.writeShort(pet.getAddSkill());
/* 1576 */     mplew.writeInt(0);
/* 1577 */     mplew.writeInt(0);
/* 1578 */     mplew.writeShort(0);
   }





































































































   public static void addShopInfo(MaplePacketLittleEndianWriter mplew, MapleShop shop, MapleClient c, int shopId) {
/* 1682 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();




/* 1687 */     mplew.writeInt(0);
/* 1688 */     mplew.writeLong(0L);
/* 1689 */     mplew.writeLong(2L);
/* 1690 */     mplew.writeInt(DateUtil.getTime());

/* 1692 */     mplew.write((shop.getRanks().size() > 0) ? 1 : 0);
/* 1693 */     if (shop.getRanks().size() > 0) {
/* 1694 */       mplew.write(shop.getRanks().size());
/* 1695 */       for (Pair<Integer, String> s : (Iterable<Pair<Integer, String>>)shop.getRanks()) {
/* 1696 */         mplew.writeInt(((Integer)s.left).intValue());
/* 1697 */         mplew.writeMapleAsciiString((String)s.right);
       }
     }

/* 1701 */     List<MapleShopItem> shopItems = shop.getItems(c);
/* 1702 */     mplew.writeShort(shopItems.size());
/* 1703 */     for (MapleShopItem item : shopItems) {
/* 1704 */       mplew.writeInt(100000);
/* 1705 */       mplew.writeInt(item.getItemId());
/* 1706 */       mplew.writeInt(item.getCategory());
/* 1707 */       mplew.writeInt(100000);
/* 1708 */       mplew.writeInt(1440 * item.getPeriod());
/* 1709 */       mplew.writeInt(item.getState());
/* 1710 */       mplew.writeInt((item.getPointtype() == 0) ? item.getPrice() : 0);
/* 1711 */       mplew.writeInt(item.getReqItem());
/* 1712 */       mplew.writeInt(item.getReqItemQ());
/* 1713 */       mplew.writeInt(item.getPointtype());
/* 1714 */       mplew.writeInt((item.getPointtype() == 0) ? 0 : item.getPrice());
/* 1715 */       mplew.writeInt(item.getMinLevel());
/* 1716 */       mplew.write(0);
/* 1717 */       mplew.writeInt(0);
/* 1718 */       mplew.writeInt(0);
/* 1719 */       mplew.writeInt(0);
/* 1720 */       mplew.writeInt(0);
/* 1721 */       mplew.writeShort(0);
/* 1722 */       mplew.writeLong(getTime(-2L));
/* 1723 */       mplew.writeLong(getTime(-1L));
/* 1724 */       mplew.writeInt(0);
/* 1725 */       mplew.writeInt(1);
/* 1726 */       mplew.writeShort(0);
/* 1727 */       mplew.writeShort(0);
/* 1728 */       mplew.writeLong(0L);
/* 1729 */       mplew.write(0);
/* 1730 */       mplew.write(0);
/* 1731 */       if (ItemConstants.is飞镖道具(item.getItemId()) || ItemConstants.is子弹道具(item.getItemId())) {

/* 1733 */         mplew.writeAsciiString("333333");
/* 1734 */         mplew.writeShort(BitTools.doubleToShortBits(ii.getUnitPrice(item.getItemId())));
/* 1735 */         mplew.writeShort(ii.getSlotMax(item.getItemId()));
       } else {
/* 1737 */         mplew.writeShort(1);
/* 1738 */         mplew.writeShort(item.getBuyable());
       }
/* 1740 */       mplew.writeLong(getTime(-1L));
/* 1741 */       mplew.writeLong(0L);
/* 1742 */       mplew.writeMapleAsciiString("1900010100");
/* 1743 */       mplew.writeMapleAsciiString("2079010100");

/* 1745 */       mplew.write(0);

/* 1747 */       if (shop.getRanks().size() > 0) {
/* 1748 */         mplew.write((item.getPosition() >= 0) ? 1 : 0);
/* 1749 */         if (item.getPosition() >= 0) {
/* 1750 */           mplew.write(item.getPosition());
         }
       }
/* 1753 */       for (int i = 0; i < 4; i++) {
/* 1754 */         mplew.writeInt(0);
       }

/* 1757 */       int[] idarr = { 9410165, 9410166, 9410167, 9410168, 9410198 };
/* 1758 */       for (int k = 0; k < idarr.length; k++) {
/* 1759 */         mplew.writeInt(idarr[k]);
/* 1760 */         mplew.writeInt(c.getPlayer().getFriendShipPoints()[k]);
       }


/* 1764 */       Item rebuy = item.getRebuy();
/* 1765 */       mplew.write((rebuy == null) ? 0 : 1);
/* 1766 */       if (rebuy != null) {
/* 1767 */         addItemInfo(mplew, rebuy);
       }
     }
   }

   public static void addJaguarInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1773 */     if (JobConstants.is豹弩游侠(chr.getJob())) {
/* 1774 */       mplew.write(chr.getIntNoRecord(111112));

/* 1776 */       for (int i = 1; i <= 5; i++) {
/* 1777 */         mplew.writeInt(i);
       }
     }
   }

   public static void addInnerSkillInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1783 */     mplew.writeShort(chr.getInnerSkillSize());
/* 1784 */     for (int i = 0; i < chr.getInnerSkillSize(); i++) {
/* 1785 */       InnerSkillEntry innerSkill = chr.getInnerSkills()[i];
/* 1786 */       if (innerSkill != null) {
/* 1787 */         mplew.write(innerSkill.getPosition());
/* 1788 */         mplew.writeInt(innerSkill.getSkillId());
/* 1789 */         mplew.write(innerSkill.getSkillLevel());
/* 1790 */         mplew.write(innerSkill.getRank());
       }
     }
   }

   public static void addLittleWhite(MaplePacketLittleEndianWriter mplew, MapleCharacter chr) {
/* 1796 */     mplew.write(JobConstants.is阴阳师(chr.getJob()) ? 1 : 0);
/* 1797 */     if (JobConstants.is阴阳师(chr.getJob())) {
/* 1798 */       mplew.writeInt(chr.getId());
/* 1799 */       mplew.writeInt(chr.getLittleWhite().getSkillId());
/* 1800 */       mplew.write(1);
/* 1801 */       mplew.writePos(chr.getLittleWhite().getTruePosition());
/* 1802 */       mplew.writeInt(0);
     }
   }

   public static void writeDressUpInfo(MaplePacketLittleEndianWriter mplew, MapleCharacter player) {
/* 1807 */     boolean bl2 = JobConstants.is爆莉萌天使(player.getJob());
/* 1808 */     if (bl2 && player.getKeyValue("Longcoat") == null) {
/* 1809 */       player.setKeyValue("Longcoat", "1051291");
     }
/* 1811 */     mplew.writeInt(bl2 ? player.getSecondFace() : 0);
/* 1812 */     mplew.writeInt(bl2 ? player.getSecondHair() : 0);
/* 1813 */     mplew.writeInt(bl2 ? Integer.valueOf(player.getKeyValue("Longcoat")).intValue() : 0);
/* 1814 */     mplew.write(bl2 ? player.getSecondSkinColor() : 0);
/* 1815 */     mplew.writeInt(-1);
/* 1816 */     mplew.writeInt(0);
/* 1817 */     mplew.writeInt(0);
   }


   public static void write剑刃之壁(MaplePacketLittleEndianWriter mplew, MapleCharacter player, int sourceid) {
/* 1822 */     ArrayList<Integer> arrayList = new ArrayList<>();
/* 1823 */     int n4 = 0;
/* 1824 */     switch (sourceid) {
       case 61101002:
/* 1826 */         n4 = 1;
         break;

       case 61120007:
/* 1830 */         n4 = 2;
         break;

       case 61110211:
/* 1834 */         n4 = 3;
         break;

       case 61121217:
/* 1838 */         n4 = 4;
         break;
     }
/* 1841 */     int n5 = (sourceid == 61101002 || sourceid == 61110211) ? 3 : ((sourceid == 0) ? 0 : 5);
/* 1842 */     for (int i2 = 0; i2 < n5; i2++) {
/* 1843 */       arrayList.add(Integer.valueOf(0));
     }
/* 1845 */     mplew.writeInt(n4);
/* 1846 */     mplew.writeInt(n5);
/* 1847 */     mplew.writeInt(player.getSpecialStat().getArrowsMode());
/* 1848 */     mplew.writeInt(arrayList.size());
/* 1849 */     arrayList.forEach(mplew::writeInt);
   }

   public static void writeSonOfLinkedSkill(MaplePacketLittleEndianWriter mplew, int skillId, Pair<Integer, SkillEntry> skillinfo) {
/* 1853 */     mplew.writeInt(((Integer)skillinfo.getLeft()).intValue());
/* 1854 */     mplew.writeInt(((SkillEntry)skillinfo.getRight()).teachId);
/* 1855 */     mplew.writeInt(skillId);
/* 1856 */     mplew.writeShort(((SkillEntry)skillinfo.getRight()).skillevel);
/* 1857 */     mplew.writeLong(getTime(((SkillEntry)skillinfo.getRight()).expiration));
/* 1858 */     mplew.writeInt(0);
   }

   public static void writeArcInfo(MaplePacketLittleEndianWriter mplew, Equip equip) {
/* 1862 */     short arcLevel = equip.getARCLevel();
/* 1863 */     int type = equip.getItemId() % 10;
/* 1864 */     mplew.writeInt(0);
/* 1865 */     mplew.writeInt(type);
/* 1866 */     mplew.writeInt(ItemConstants.getArcUplevelNeedExp(arcLevel, type));
/* 1867 */     mplew.writeLong(ItemConstants.getArcUplevelNeedMeso(arcLevel, type));
/* 1868 */     mplew.writeLong(0L);
/* 1869 */     mplew.writeShort(0);
/* 1870 */     mplew.writeShort(0);
/* 1871 */     mplew.writeShort(0);
/* 1872 */     mplew.writeShort(0);
/* 1873 */     mplew.writeShort(0);
/* 1874 */     mplew.writeShort(0);
/* 1875 */     mplew.writeShort(0);
/* 1876 */     mplew.writeShort(0);
/* 1877 */     mplew.writeShort(0);
/* 1878 */     mplew.writeShort(0);
/* 1879 */     mplew.writeShort(0);
/* 1880 */     mplew.writeShort(0);
   }
 }


/* Location:              C:\PGX\Server.jar!\tools\packet\PacketHelper.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */